Computer Science Lesson Plan
Class: 8 - Lesson: 18 Synchronous vs Asynchronous Programming

Purpose: To learn the difference between synchronous and asynchronous programming, and to use an AI coding tool to find and fix errors in code.

No. of Classes

Two classes (one class = one and a half hours).

Material Required
  1. Desktop computer or laptop.
  2. Circuit Playground Express board.
  3. USB cable.
  4. Internet connection.
  5. Red, green and yellow LEDs with alligator clips.
Prior Knowledge

Students should know:

  • The internal and external LEDs, and how to use functions.
  • Exercise

    Exercise 1



    1. Create a traffic light system with red, green and yellow LEDs. The lights should change in order, one after another. (Synchronous)

    Exercise 2



    1. Design a project in which three LEDs blink at different speeds - 1 second, 2 seconds and 3 seconds. (Asynchronous)

    Exercise 3



    1. Debug the given code using an AI coding tool. Identify and fix the error in the code.


    Teacher Instructions
    1. Teachers should explain that in a synchronous program each step waits for the previous one to finish, while in an asynchronous program several things can happen at the same time.
    2. Teachers should prepare before the class.
    3. Teachers should ensure that students complete all three exercises.
    4. Teachers may allow students to complete the exercise as pair programming.
    5. When using the AI coding tool, ask students to read the explanation the tool gives and check whether they agree with it, rather than just copying the corrected code.